//
//  AFHTTPRequestOperationManager+KLRACSupport.h
//  KoalaUtilKit
//
//  Created by Tommy on 15/1/8.
//  Copyright (c) 2015年 Koala Team. All rights reserved.
//
// almost copy from AFNetworking+RACExtension
// just add progress 

#import "AFHTTPRequestOperationManager.h"
#import "RACAFNetworking.h"
#import "ReactiveCocoa.h"


@interface AFHTTPRequestOperationManager (KLRACSupport)

- (RACSignal *)klrac_enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)requestOperation;

/// A convenience around -GET:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_GET:(NSString *)path parameters:(id)parameters;

/// A convenience around -POST:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_POST:(NSString *)path parameters:(id)parameters;

/// A convenience around -PUT:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_PUT:(NSString *)path parameters:(id)parameters;

/// A convenience around -DELETE:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_DELETE:(NSString *)path parameters:(id)parameters;

/// A convenience around -PATCH:parameters:success:failure: that returns a cold signal of the
/// resulting JSON object or error.
- (RACSignal *)klrac_PATCH:(NSString *)path parameters:(id)parameters;


//support upload and download
- (RACSignal *)klrac_upload:(NSString *)path parameters:(id)parameters constructingBodyWithBlock:(void (^)(id <AFMultipartFormData> formData))block;
- (RACSignal *)klrac_download:(NSString *)path parameters:(id)parameters filePath:(NSString*)filePath;




@end
